package com.hzdy.master.config;


import org.springframework.beans.factory.ObjectFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.ConversionService;
import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;

import java.util.ArrayList;
import java.util.List;

@Configuration
public class RepositoryConfiguration extends RepositoryRestMvcConfiguration {

    public RepositoryConfiguration(ApplicationContext context, ObjectFactory<ConversionService> conversionService)
    {
        super(context, conversionService);
    }

    @Override
    protected List<HandlerMethodArgumentResolver> defaultMethodArgumentResolvers()
    {
        List<HandlerMethodArgumentResolver> resolvers =
                new ArrayList<>(super.defaultMethodArgumentResolvers());
        System.out.println(".......................");
        resolvers.forEach(rs->{
            System.out.println(rs.getClass());
        });
        return resolvers;
    }
}